package com.action.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.controller.Action;

public class MainAction implements Action{
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		HttpSession session = request.getSession();
		String mem_id = (String)session.getAttribute("mem_id");
		
		int check = 0;
		
		if(mem_id ==null){
			check = 0;
		} else if(mem_id.equals("admin")){
			check = 1;
		} else {
			check = -1;
		}
		
		request.setAttribute("check",check);
		request.setAttribute("mem_id", mem_id);
		
		return "/view/member/main.jsp";
	}
}
